import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueRouter from 'vue-router'
import 'ant-design-vue/dist/antd.css' // 使用vueUI组件时必须要引入的样式
import { Button, Layout, Menu, Icon, Avatar, Card, Table, Tag, Divider, Modal, message, Form, FormModel, Input, Upload, Dropdown, Checkbox } from 'ant-design-vue'

Vue.use(Button)
  .use(Layout)
  .use(Menu)
  .use(Icon)
  .use(Avatar)
  .use(Card)
  .use(Table)
  .use(Tag)
  .use(Divider)
  .use(Modal)
  .use(message)
  .use(Form)
  .use(FormModel)
  .use(Input)
  .use(Upload)
  .use(Dropdown)
  .use(Checkbox)

Vue.prototype.$confirm = Modal.confirm
Vue.prototype.$message = message

// 【添加代码】解决vue-router在3.0版本以上重复点路由报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
